﻿#pragma once
#include "ADFGlobal.h"
#include <QReadWriteLock>
#include "AsGlobalData.h"
#include "AsMetaType.h"

// 核心流程业务数据类，单例运行程序

class ADF_EXPORT AsProcessCoreData : public AsGlobalData {
	Q_OBJECT

private:
	QMap<int, cv::Mat>	m_mpMat;
	QReadWriteLock		m_lock;
	bool				m_bRun;

public:
	AsProcessCoreData();
	~AsProcessCoreData();

public:
	void storeMat(int key, const cv::Mat& mat);		//设置检测图片
	bool loadMat(int key, cv::Mat& mat);			//加载Mat
	void clearMat(int key);
	void clearAllMat();								//释放所有图像

	void setRunState(bool bRun);					//设置运行状态
	bool isRunning();								//运行状态

signals:
	void matStored(int key);						//

};

AS_DECLARE_META_TYPE(AsProcessCoreData)

